//SCAN_NODE
//Stores a TF message about the position,
//a laser scan at said position,
//and a cached grid rendition of said scan

#include "sensor_msgs/LaserScan.h"
#include <vector>
#include "geometry_msgs/TransformStamped.h"

class Mapstore;

class Scan_node {
	private:
	
	sensor_msgs::LaserScan scan;
	geometry_msgs::TransformStamped transform;
	
    void bresenham(int from_x, int from_y, int to_x, int to_y, std::vector<std::vector<int> >& on, int ink, int background, bool overwrite);
	double fastSin(double x);
	double fastCos(double x);

    int number_of_scans;
	
	public:
	
	static double resolution;
	static double maxRange;
	std::vector<std::vector<int> > render;
	int offset;
    void addScan(sensor_msgs::LaserScan newScan);
    void addScan(sensor_msgs::LaserScan newScan, bool shouldUpdateRender);
	void setTransform(geometry_msgs::TransformStamped newTransform);
	static void setResolution(double newResolution);
	static void setMaxRange(double newMaxRange);
	Scan_node();
	Scan_node(sensor_msgs::LaserScan scan, geometry_msgs::TransformStamped transform);
	void updateRender();
	geometry_msgs::TransformStamped getTransform();

    Mapstore* storePtr;

    int getNumberOfScans();
};



